package com.tensquare.friend.dao;


import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.tensquare.friend.pojo.Friend;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface FriendDao extends BaseMapper<Friend> {
    @Select("SELECT * FROM tb_friend WHERE userid=#{userid} AND friendid=#{friendid}")
    public Friend findByUserIdAndFriendId(@Param("userid") String userid, @Param("friendid") String friendid);
    @Select("UPDATE  tb_friend SET islike=#{X} WHERE userid=#{userid} AND friendid=#{friendid}")
    public void updateByUserIdAndFriendIdToX(@Param("userid") String userid, @Param("friendid") String friendid,@Param("X") String x);
    @Select("delete FROM tb_friend WHERE userid=#{userid} AND friendid=#{friendid}")
    void deleteByUserAndFriend(@Param("userid") String userid, @Param("friendid") String friendid);
}
